<%
# Copyright (C) 2011 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
%>

<%
   js_bundle :eportfolio
%>
<% content_for :page_title do %>
  {{#t}}My ePortfolios{{/t}}
<% end %>

<h1 class="screenreader-only">{{#t}}ePortfolios{{/t}}</h1>
<% content_for :right_side do %>
  <a href="#" class="add_eportfolio_link btn button-sidebar-wide">
    {{> icons/add}}
    {{#t}}Create an ePortfolio{{/t}}
  </a>
<% end %>

<% if @portfolios.empty? %>
  <!-- when @portfolios.empty? then dont show the right hand side, it makes it look cleaner -->
  <style type="text/css">
    #sidebar{ display:none;}
  </style>
  <div id="whats_an_eportfolio">
  <h2>{{#t}}What's an ePortfolio?{{/t}}</h2>
  <%= mt('what.details1', <<-DETAILS)
ePortfolios are a place where you can display and discuss the significant
submissions and experiences that are happening during your learning
process. You can use an ePortfolio to:

* Display the papers you're proud of for more than just your instructor to see
* Talk about all the thought and work that went into your class submissions
* Gather an overview of your educational experience as a whole
* Share your work with friends, future employers, etc.

ePortfolios can be public for everyone to see, or private so only those you
allow can see, and you can change that setting at any time.

Ready to get started? Click the button.
DETAILS
  %>
  <div class="button-container">
    <a href="#" class="add_eportfolio_link btn button-sidebar-wide">{{> icons/add}} {{#t}}Create an ePortfolio{{/t}}</a>
  </div>
  </div>
<% else %>
  <h2>{{#t}}My ePortfolios{{/t}}</h2>
  <ul class="unstyled_list" style="padding-left: 20px;">
    {{> views/eportfolio}}
  </ul>
<% end %>
<%= form_for Eportfolio.new, :url => eportfolios_path, :html => {:style => "display: none;", :id => "add_eportfolio_form"} do |f| %>
<h2>{{#t}}Make an ePortfolio{{/t}}</h2>
<table class="formtable">
  <tr>
    <td><%= f.label :name, before_label(:eportfolio_name, "ePortfolio Name") %></td>
    <td><%= f.text_field :name, :value => t('defaults.eportfolio_name', "My Portfolio") %></td>
  </tr><tr>
    <td colspan="2">
      <%= f.check_box :public, :value => true %>
      <%= f.label :public, t('labels.make_public', "Make it Public"), :checked => true %>
    </td>
  </tr><tr>
    <td colspan="2">
      <button class="btn " id="eportfolio_submit" name="commit" type="submit">{{#t}}Make ePortfolio{{/t}}</button>
      <button type="button" class="cancel_button btn button-secondary" style>{{#t}}Cancel{{/t}}</button>
    </td>
  <td>
</table>
<% end %>
